package com.ten.jinxiancun.controller;

import com.ten.jinxiancun.server.impl.PurchasereturnsServerImpl;
import com.ten.jinxiancun.utils.R;
import com.ten.jinxiancun.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;
//采购退货单
@RestController
@RequestMapping("/PurTurn")
public class PurchasereturnsController {
    @Autowired
    PurchasereturnsServerImpl purturn;

    @RequestMapping("/getAllPurTurn")
    public Object getAllPurTurn(@RequestParam Map<String, Object> map) {
        Integer limit = Integer.parseInt(map.get("limit").toString());
        Integer page = Integer.parseInt(map.get("page").toString());
        map.put("limit", limit);
        map.put("page", (page - 1) * limit);
        Result res = new Result("0", "true", purturn.countFind(map), purturn.getAllPurTurnFind(map));
        return res;
    }
}
